#pragma once

#include <boost/unordered_set.hpp>
#include <engine.script/System.hpp>

#include "exports.hpp"
#include "Component.hpp"




namespace Engine
{
	namespace Entity
	{
		class System;

		class Object
			: public Script::Object
		{
		public:

			typedef Script::pointer<Object>   ptr;

			Object(System* system);
			virtual ~Object();



			/**
			 * @returns the number of components, this entity has attached
			 */
			unsigned int numComponents() const;



			void attach(Component* component);
			void detach(Component* component);

			void attach(asIScriptObject* object);
			void detach(asIScriptObject* object);



			static void registerType(Script::System::ptr engine);

		private:

			System*        m_system;
			unsigned int   m_numComponents;
		};
		///////////////////////////////////////////////////////////////////////////////////////////
	}
	///////////////////////////////////////////////////////////////////////////////////////////////
}
///////////////////////////////////////////////////////////////////////////////////////////////////
